package com.tiancheng.trade.settlement.feign;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.settlement.feign.dto.FilerUploadResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


/**
 * 文件上传服务
 */
//@FeignClient(value = "common-file", path = "/file")
@FeignClient(value = "common-file",path = "/mid-api/common/file/file")
public interface FileUpload {
    /**
     * 文件上传
     *
     * @param file     文件
     * @param readType PUBLIC_READ为公有读; AUTH_READ为认证读; OWNER_READ为所有者读;
     */
    @PostMapping(path = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<FilerUploadResult> upload(@RequestPart(value = "file") MultipartFile file,
                                     @RequestPart String readType);
}
